#include <iostream>
#include <string>
#include <vector>
using namespace std;
int a[70]; // 奖金比例

class player
{
public:
    string name;
    int score[4];
    bool dq = false;  // true 犯规了 false 没有犯规
    bool type = true; // ture 正规选手 false 业余选手
    int total;
public:
    friend istream &operator>>(ostream &out, player &p);
};

// 处理player输入，包括姓名,得分
istream &operator>>(istream &in, player &p)
{
    in >> p.name;
    if (p.name[p.name.length() - 1] == '*')
        p.type = false;
    string tmp;
    for (int i = 0; i < 4; i++)
    {
        in >> tmp;
        if (tmp == "DQ")
        {
            p.dq = true;
            for (int j = i; j < 4; j++)
            {
                p.score[j] = -1;
            }
            return in;
        }
        p.score[i] = atoi(tmp.c_str());
    }
    p.dq = false;
    return in;
}

int main()
{
    int n, num;
    cin >> n;
    for (int i = 0; i < 70; i++)
        cin >> a[i];

    cin>>num;
    vector<player> P;
    player tmp;
    for(int i=0;i<num;i++){
        cin>>tmp;
        P.push_back(tmp);
    }

    cout << "Player Name"
         << " "
         << "RD1 RD2 RD3 RD4 TOTAL Money Won" << endl;
    cout << "----------------------------------------------------" << endl;

    return 0;
}